package com.example.eeuse.controller;

import com.example.eeuse.model.EsVedaSnapshot;
import com.example.eeuse.service.MockMockServiceImpl;
import com.example.eeuse.service.MockService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/mock")
@Slf4j
public class MockController {


    @Autowired
    private MockService mockService;

    @Autowired
    private MockMockServiceImpl mockMockServiceImpl;

    @GetMapping("/test")
    public String test() {
        return "succ";
    }


    @GetMapping("/source")
    public String source() {
        EsVedaSnapshot result= mockService.find("1");
        return result.getVal();
    }

    @GetMapping("/source1")
    public String source1() {
        //EsVedaSnapshot result= mockMockServiceImpl.find("1");
        log.info("1");
        int i=1;
        String a=null;
        try{
           long s= Long.valueOf(a);
        }catch (Exception e)
        {
            log.error("hello err",e);
        }
        return "";
    }
}
